import cn.net.xyan.blossom.kotlin.DateExt
import cn.net.xyan.blossom.kotlin.logger
import com.fasterxml.jackson.dataformat.xml.XmlMapper
import com.wondersgroups.yypt.QueryScheduleExpertReq
import com.wondersgroups.yypt.his.ServiceSoapForHisClientService
import org.junit.Test
import java.net.URL
import java.util.*

class HisScheduleTest {
    @Test
    fun test() {



        val xmlMapper = XmlMapper()

        //val url = URL("http://localhost:8080/cxf/ServiceForHis?wsdl")
        val url = URL("http://192.168.203.90:8080/test/cxf/ServiceForHis?wsdl")

        val gcal = GregorianCalendar()
        //val url = URL("http://127.0.0.1:8080/cxf/ServiceATM?wsdl")
        var service = ServiceSoapForHisClientService(url)

        val port = service.serviceSoapForHisClientPort

        val req = """
            <msg>
<QueryScheduleExpertReq>
    <startDate>2018-03-12</startDate>
    <endDate>2018-03-13</endDate>
    <region>1</region>
    <status>0</status>
    <vendor>local</vendor>
</QueryScheduleExpertReq></msg>
        """.trimIndent()



       // val reqString = xmlMapper.writeValueAsString(req);
        logger.info(req)
        val rsp = port.queryExperts(req)

        logger.info(rsp)

    }
}